﻿/*
This script was created by Visual Studio on 14/06/2010 at 1:06 PM.
Run this script on [ASUSG51J\sqlexpress.EmptyCuppa] to make it the same as [ASUSG51J\sqlexpress.YourCuppa].
This script performs its actions in the following order:
1. Disable foreign-key constraints.
2. Perform DELETE commands. 
3. Perform UPDATE commands.
4. Perform INSERT commands.
5. Re-enable foreign-key constraints.
Please back up your target database before running this script.
*/
SET NUMERIC_ROUNDABORT OFF
GO
SET XACT_ABORT, ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*Pointer used for text / image updates. This might not be needed, but is declared here just in case*/
DECLARE @pv binary(16)
BEGIN TRANSACTION
ALTER TABLE [dbo].[IssuedToken] DROP CONSTRAINT [FK_IssuedToken_Consumer]
ALTER TABLE [dbo].[IssuedToken] DROP CONSTRAINT [FK_IssuedToken_User]
ALTER TABLE [dbo].[UserRole] DROP CONSTRAINT [FK_UserRole_Role]
ALTER TABLE [dbo].[UserRole] DROP CONSTRAINT [FK_UserRole_User]
ALTER TABLE [dbo].[AuthenticationToken] DROP CONSTRAINT [FK_AuthenticationToken_User]
SET IDENTITY_INSERT [dbo].[User] ON
INSERT INTO [dbo].[User] ([UserId], [FirstName], [LastName], [EmailAddress], [EmailAddressVerified], [CreatedOn]) VALUES (1, NULL, NULL, N'matthew_erbs@hotmail.com', 1, '20100614 02:24:19.707')
INSERT INTO [dbo].[User] ([UserId], [FirstName], [LastName], [EmailAddress], [EmailAddressVerified], [CreatedOn]) VALUES (2, NULL, NULL, N'matthew_erbs@hotmail.com', 1, '20100614 03:02:57.350')
SET IDENTITY_INSERT [dbo].[User] OFF
SET IDENTITY_INSERT [dbo].[AuthenticationToken] ON
INSERT INTO [dbo].[AuthenticationToken] ([AuthenticationTokenId], [UserId], [OpenIdClaimedIdentifier], [OpenIdFriendlyIdentifier], [CreatedOn], [LastUsed], [UsageCount]) VALUES (1, 1, N'https://www.google.com/accounts/o8/id?id=AItOawnOJKm9bmF4MQiOAFAL_i55EYDYcID1pM0', N'www.google.com/accounts/o8/id', '20100614 02:24:19.710', '20100614 02:24:19.710', 1)
INSERT INTO [dbo].[AuthenticationToken] ([AuthenticationTokenId], [UserId], [OpenIdClaimedIdentifier], [OpenIdFriendlyIdentifier], [CreatedOn], [LastUsed], [UsageCount]) VALUES (2, 2, N'https://www.google.com/accounts/o8/id?id=AItOawn5IU94tGuN-iZP0oOAsvYndQcN1TbaGyA', N'www.google.com/accounts/o8/id', '20100614 03:02:57.350', '20100614 03:02:57.353', 1)
SET IDENTITY_INSERT [dbo].[AuthenticationToken] OFF
SET IDENTITY_INSERT [dbo].[OpenIDAssociation] ON
INSERT INTO [dbo].[OpenIDAssociation] ([DistinguishingFactor], [AssociationHandle], [AssociationId], [Expiration], [PrivateData], [PrivateDataLength]) VALUES (N'https://open.login.yahooapis.com/openid/op/auth', N'rwkx5.OBl73dO2Q9YHWRFbKUvD8Hm5AYQ2_l79PGTmlnTtDaOgeOo1xqbUkYjE1KrWSL3agi8T3nUcEtcG8j3bK7q_9uKXG6tCwNuFCU92k6BUAO92hVCbIyHqc0sQPEnJAmVm7a', 1, '20100614 06:24:03.000', 0xb0e1b2c81ebc583ee39bbd7414b981973483cf1a75b76e9a52a8099bd65dcd8d0000000000000000000000000000000000000000000000000000000000000000, 32)
INSERT INTO [dbo].[OpenIDAssociation] ([DistinguishingFactor], [AssociationHandle], [AssociationId], [Expiration], [PrivateData], [PrivateDataLength]) VALUES (N'https://www.google.com/accounts/o8/ud', N'AOQobUeW1YR5IVAlM3E66sm1VTTXwnKNWYfcdF-nMizxbUeLtb1oM61ME5asTq-ufvE7VBnM', 2, '20100614 15:24:04.000', 0xc28c12c532a6537d7b418035fc47c2bfaec06dad54321fb2182d5c1db2f6256c0000000000000000000000000000000000000000000000000000000000000000, 32)
SET IDENTITY_INSERT [dbo].[OpenIDAssociation] OFF
SET IDENTITY_INSERT [dbo].[Nonce] ON
INSERT INTO [dbo].[Nonce] ([Context], [Code], [Issued], [NonceId], [Expires]) VALUES (N'https://www.google.com/accounts/o8/ud', N'-omyyRFie9UVBQ', '20100614 02:24:59.000', 2, '20100614 02:37:59.000')
INSERT INTO [dbo].[Nonce] ([Context], [Code], [Issued], [NonceId], [Expires]) VALUES (N'https://www.google.com/accounts/o8/ud', N'59oNisxB-KJpXw', '20100614 02:24:20.000', 1, '20100614 02:37:20.000')
INSERT INTO [dbo].[Nonce] ([Context], [Code], [Issued], [NonceId], [Expires]) VALUES (N'https://www.google.com/accounts/o8/ud', N'nwD56aAjnIX0iw', '20100614 03:02:57.000', 3, '20100614 03:15:57.000')
SET IDENTITY_INSERT [dbo].[Nonce] OFF
ALTER TABLE [dbo].[IssuedToken] ADD CONSTRAINT [FK_IssuedToken_Consumer] FOREIGN KEY ([ConsumerId]) REFERENCES [dbo].[Consumer] ([ConsumerId]) ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE [dbo].[IssuedToken] ADD CONSTRAINT [FK_IssuedToken_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE [dbo].[UserRole] ADD CONSTRAINT [FK_UserRole_Role] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Role] ([RoleId]) ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE [dbo].[UserRole] ADD CONSTRAINT [FK_UserRole_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE
ALTER TABLE [dbo].[AuthenticationToken] ADD CONSTRAINT [FK_AuthenticationToken_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE
COMMIT TRANSACTION
